#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<cstdio>
using namespace std;
int N, M, T;
int r1, c1, r2, c2;
int dirx[4] = { 0,0,1,-1 };
int diry[4] = { 1,-1,0,0 };
char map[110][110];
int rem[110][110][19];

int dfs(int x, int y, int time)
{
	if (rem[x][y][time] != -1)return rem[x][y][time];
	if (abs(x - r2) + abs(y - c2) > T - time)return rem[x][y][time] = 0;
	if (time > T)return rem[x][y][time] = 0;
	if (time == T) {
		if (r2 == x && c2 == y) return rem[x][y][time] = 1;
		return rem[x][y][time] = 0;
	}
	int ans = 0;
	for (int i = 0; i < 4; i++) {
		if (map[x + dirx[i]][y + diry[i]] == '*' || x + dirx[i]<1 || x + dirx[i]>N || y + diry[i]<1 || y + diry[i]>M)continue;
		ans += dfs(x + dirx[i], y + diry[i], time + 1);
	}
	return rem[x][y][time] = ans;
}

int main()
{
	cin >> N >> M >> T;
	for (int i = 1; i <= N; i++)
		cin >> (map[i] + 1);
	cin >> r1 >> c1 >> r2 >> c2;
	memset(rem, -1, sizeof(rem));
	cout << dfs(r1, c1, 0) << endl;
	return 0;
}